<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" href="../css/ui-box.css">
	<link rel="stylesheet" href="../css/ui-base.css">
	<link rel="stylesheet" href="../css/ui-input.css">
	<link rel="stylesheet" href="../css/project/style.css">
	<link rel="stylesheet" href="css/login4.css">
	<script src="../js/zy_control.js"></script>
    <script src="../js/zy_click.js"></script>
    <script src="../js/main.js"></script>
	<script src="../js/zy_json.js"></script>
	<script src="../js/saplife.js"></script>
	<script src="../js/hmac-sha256.js"></script>
</head>
<body class="um-vp c-wh" ontouchstart>
    <div id="page_0" class="up ub ub-ver loginBg ub-img1" tabindex="0">
        <!--header开始-->
        <div id="header" class="uh t-wh ub ubb b-bla-L2 us-L2">
        	<div class="umw4 ub ub-ac ub-pc" ontouchstart="zy_touch()" onclick="">
					<div class="t_btn1 ub-img btn_wh1"></div>
        	</div>
            <h1 class="ut ub-f1 ulev-3 ut-s tx-c" tabindex="0">SAP Life</h1>
			<div class="umw4" ontouchstart="zy_touch()" onclick="">
        	</div>
        </div>
        <!--header结束--><!--content开始-->
        <div id="content" class="ub-f1 tx-l t-bla ">
            <div class="ub ub-ver uinn-a1">
		    	<div class="ub ub-ver">
		    		<div class="uba b-gra3 uc-a1 ">
				        <div class="ubb b-gra3 ub uinn-a4 t-gra2 ub-ac c-wh">
				            <div class="userImg btn_wh1 ub-img mar-ar2"></div>
				            <div class="ub-f1">
				                <div class="uinput uinn4">
				                    <input placeholder="用户名" id="uid" type="text" class="">
				                </div> 
				            </div>
				        </div>
				        <div class=" ub uinn-a5 t-gra2 ub-ac c-wh">
				            <div class="pwdImg btn_wh1 ub-img mar-ar2"></div>
				            <div class="ub-f1">
				                <div class="uinput uinn4">
				                    <input placeholder="密码" id="upwd" type="password" class="">
				                </div> 
				            </div>
				        </div>
					</div>
					<div class="ub ub-ver">
			            <div class="ub ub-pe uinn-a6 t-blu ulev-4">忘记密码</div>
			            <div class="uinn-at1">
							<div ontouchstart="zy_touch('btn-act')" onclick="login()" class="uinn-a2 btn_hei1 c-blu uc-a1 t-wh tx-c">登 录</div>
			            </div>
			            <div class="uinn-at2 ub t-wh ulev-4">
			                <div class="ub-f1">立即注册</div>
			            </div>
			        </div>
				</div>
			</div>
        </div>
        <!--content结束-->
    </div>
</body>
<script>
zy_init();
window.uexOnload = function(type){
    if (!type) {
       //zy_con("content", "../login_content/login_content.html", 0, $$("header").offsetHeight);
    }
	window.onorientationchange=window.onresize=function()
	{
		zy_resize("content",0,$$("header").offsetHeight);				
	}
}

function login(){
    var data;
	var logname = document.getElementById('uid').value;
	var logpwd = document.getElementById('upwd').value;
    var logtime = Date.now() - 1000 * 10;
    logpwd = CryptoJS.SHA256(logpwd).toString();
    logpwd = CryptoJS.HmacSHA256(logpwd, 'jsGen').toString();
    logpwd = CryptoJS.HmacSHA256(logpwd, logname + ':' + logtime).toString();
    var url = userApiUrl + "/login";
    var xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function(result){
        if (xhr.readyState == 4) {
            var responseText = xhr.responseText;
            var response = JSON.parse(responseText);
			if (response.ack == false) {
				alert("error username/password!!");	
			} else {
				openNewWin("index", "../index/index.html");
			}
 
        }
    };
    xhr.open("POST", url, true);
    xhr.setRequestHeader("Accept", "application/json, text/plain, */*");
    xhr.setRequestHeader("Content-Type", "application/json;charset=utf-8");
    xhr.send("{\"logauto\":true,\"logname\":\"" + logname + "\",\"logpwd\":\"" + logpwd + "\",\"logtime\":" + logtime + "}");
}

</script>
</html>